'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 竞技场
 * @author agl
 */

var _ = require('lodash');
var moment = require('moment');
var async = require('async');
var modelUtil = require('../util/modelUtil');
var constantUtil = require('../util/constantUtil');
var Code = require('../consts/code.js');
var mongoConnector = require('../libs/mongodb/mongoConnector');
/* jshint unused:false */
var goldCarbonSchema = require('../schemas/goldCarbonSchema');
var GoldCarbon = mongoConnector().model('GoldCarbon');
var PlayerManager = require('../libs/playerManager');

/**
 * 根据角色id获取竞技场数据
 */
module.exports.getByRoleId = function (role_id, cb) {
    modelUtil.getByRoleId(GoldCarbon, role_id, function (err, model) {
        if (!!err) {
            console.error(err);
            return cb(err);
        }
        cb(null, model);
    });
};

/**
 * 刷新数据
 */
module.exports.onFiveRefresh = function (self, cb) {
    self.resetFightTimes();
    cb();
};
